Can we put a condition in setInterval Timer